<?php

/**
 * Clientorder form base class.
 *
 * @method Clientorder getObject() Returns the current form's model object
 *
 * @package    briefing
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseClientorderForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'idorder'               => new sfWidgetFormInputHidden(),
      'ordername'             => new sfWidgetFormInputText(),
      'textcategoryid'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Textcategories'), 'add_empty' => false)),
      'is_website'            => new sfWidgetFormInputCheckbox(),
      'is_print'              => new sfWidgetFormInputCheckbox(),
      'is_newsletter'         => new sfWidgetFormInputCheckbox(),
      'is_poster'             => new sfWidgetFormInputCheckbox(),
      'is_blog'               => new sfWidgetFormInputCheckbox(),
      'othertextmediumid'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Othertextmedium'), 'add_empty' => true)),
      'targetgroupid'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Targetgroup'), 'add_empty' => true)),
      'is_existing_custormer' => new sfWidgetFormInputCheckbox(),
      'is_new_customer'       => new sfWidgetFormInputCheckbox(),
      'is_women'              => new sfWidgetFormInputCheckbox(),
      'is_men'                => new sfWidgetFormInputCheckbox(),
      'formalstyleid'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Formalstyle'), 'add_empty' => false)),
      'personstyleid'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Personstyle'), 'add_empty' => false)),
      'emotionstyleid'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Emotionstyle'), 'add_empty' => false)),
      'formulateid'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Formulatetext'), 'add_empty' => false)),
      'freetextid'            => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Freetext'), 'add_empty' => true)),
      'urlimagestructure'     => new sfWidgetFormInputText(),
      'is_standard'           => new sfWidgetFormInputCheckbox(),
      'editionoptionsid'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Editionoptions'), 'add_empty' => true)),
      'created_at'            => new sfWidgetFormDateTime(),
      'expires_at'            => new sfWidgetFormDateTime(),
      'updated_at'            => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'idorder'               => new sfValidatorChoice(array('choices' => array($this->getObject()->get('idorder')), 'empty_value' => $this->getObject()->get('idorder'), 'required' => false)),
      'ordername'             => new sfValidatorString(array('max_length' => 45)),
      'textcategoryid'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Textcategories'))),
      'is_website'            => new sfValidatorBoolean(),
      'is_print'              => new sfValidatorBoolean(),
      'is_newsletter'         => new sfValidatorBoolean(),
      'is_poster'             => new sfValidatorBoolean(),
      'is_blog'               => new sfValidatorBoolean(),
      'othertextmediumid'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Othertextmedium'), 'required' => false)),
      'targetgroupid'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Targetgroup'), 'required' => false)),
      'is_existing_custormer' => new sfValidatorBoolean(),
      'is_new_customer'       => new sfValidatorBoolean(),
      'is_women'              => new sfValidatorBoolean(),
      'is_men'                => new sfValidatorBoolean(),
      'formalstyleid'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Formalstyle'))),
      'personstyleid'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Personstyle'))),
      'emotionstyleid'        => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Emotionstyle'))),
      'formulateid'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Formulatetext'))),
      'freetextid'            => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Freetext'), 'required' => false)),
      'urlimagestructure'     => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'is_standard'           => new sfValidatorBoolean(),
      'editionoptionsid'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Editionoptions'), 'required' => false)),
      'created_at'            => new sfValidatorDateTime(array('required' => false)),
      'expires_at'            => new sfValidatorDateTime(array('required' => false)),
      'updated_at'            => new sfValidatorDateTime(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('clientorder[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Clientorder';
  }

}
